package com.qw.soul.permission.support.manufacturer;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.provider.Settings;

/**
 * Created by joker on 2017/8/4.
 */

public class Protogenesis implements PermissionsPage
{
    private final Context context;

    public Protogenesis(Context activity)
    {
        this.context = activity;
    }

    @Override
    public Intent settingIntent()
    {
        Intent intent;
        try
        {
            intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            Uri uri = Uri.fromParts(PACK_TAG, context.getPackageName(), null);
            intent.setData(uri);
        } catch (Exception e)
        {
            intent = new Intent(Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS);
        }
        return intent;
    }
}
